import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    component: () => import("../views/Home.vue"),
    redirect: "/location",
    children: [
      {
        path: "/location",
        component: () => import("../views/Location.vue"),
      },
      {
        path: "foods",
        component: () => import("../views/Foods.vue"),
      },
      {
        path: "shop/:id",
        component: () => import("../views/Shop.vue"),
      },
      {
        path: "orders",
        component: () => import("../views/Orders.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
